const sqlite3 = require('sqlite3').verbose();
const path = require('path');

// 连接到数据库
const dbPath = path.join(__dirname, 'back-koa', 'databases', 'travel.db');
const db = new sqlite3.Database(dbPath);

// 查询景点表结构
db.serialize(() => {
  db.all("SELECT sql FROM sqlite_master WHERE type='table' AND name='sights'", (err, rows) => {
    if (err) {
      console.error('Error querying database:', err);
      return;
    }
    
    if (rows.length > 0) {
      console.log('Sights table schema:');
      console.log(rows[0].sql);
    } else {
      console.log('Sights table not found');
    }
    
    db.close();
  });
});